<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <title><?php echo config_item('website_gasstation_title')?></title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <link rel="shortcut icon" href="<?php echo base_url() ?>public/images/favicon.ico" />
    <link href="<?php echo base_url()?>themes/gasstation/css/login.css" rel="stylesheet" />
    <style>
	.lmaisft{width:450px;border-radius:10px;text-align:left;background:white;border:1px #dddddd solid;}
	.box{box-shadow:0px 5px 15px 1px rgba(0,0,0,0.1);}
	</style>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body style="background:#E4E4E4;">
<div align="center" style="position:absolute;width:100%">
	<div id="topheih" class="blank40"></div>
	<div class="blank30"></div>
	<div class="lmaisft box">
		<div class="blank20"></div>
		<div  align="center"><img src="<?php echo base_url()?>themes/gasstation/images/logo_login.png" class="box" style="border:1px #ffffff solid; background:white" id="imglogo" align="absmiddle" height="100" width="100"><b style="font-size:22px"></b></div>
		<div class="blank10"></div>
		<form style="padding:20px;padding-left:80px" name="login" id="login" method="post" action="<?php echo site_url("gasstation/admin/login_check")?>">
			<div>
				<div><input type="text" style="height:40px;width:300px" class="input" datatype="*" nullmsg="请输入用户名！" onKeyUp="if(event.keyCode==13)$('#password').focus()" placeholder="请输入用户名" id="usercode" name="usercode" ></div>
			</div>

			<div class="blank10"></div>
			<div>
				<div><input id="password" name="password" style="height:40px;width:300px" class="input"  onKeyUp="if(event.keyCode==13)$('#yz_check').focus()"  type="password" placeholder="请输入密码" datatype="*" nullmsg="请输入密码！"></div>
			</div>
			<div class="blank10"></div>
			<div>
				 <div><input type="text" style="height:40px;width:300px" class="input" datatype="*" nullmsg="请输入验证码！" onKeyUp="if(event.keyCode==13)$('#login').submit()" placeholder="请输入验证码" name="yz_check" id="yz_check" ></div>
			</div>
			<div class="blank10"></div>
			<div align="left" style="width:300px">
				<div class="checkbox" style="float: left">
				<img id="valid_image" alt="看不清楚？点击换一张" title="看不清楚？点击换一张" src="<?php echo site_url('valid_code')?>" onclick="valid_code_refresh('<?php echo site_url('valid_code')?>')"/>
				</div>
				<div class="checkbox" style="float: right"><label><input type="checkbox" id="ck_rmbUser">记住密码</label>&nbsp; &nbsp; <font color="#888888"></font></div>
			</div>
			<div class="blank20"></div>
			<div align="left">
				<button type="submit" style="padding:10px 20px" class="webbtn" name="button">登录</button>
			</div>
			<div class="blank10"></div>
		</form>
	</div>
	<div class="blank20"></div>
	<div align="center" style="height: 30px;line-height: 30px;color: #555555;position: fixed;bottom: 20px;width: 100%;text-align: center;">
		&copy;<?php echo date('Y')?> dingdangkuaizu.com版权所有 ICP证:<a href="http://beian.miit.gov.cn/" target="_blank">鲁ICP备17042305号</a>
	</div>

</div>
<script type="text/javascript" src="<?php echo base_url() ?>public/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>public/js/jquery.cookie.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>public/js/validform.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>public/js/plugins/layer/layer.js"></script>
<script type="text/javascript" >
    //验证表单
    $(function(){
        $.Tipmsg.r=null;
        $("#login").Validform({
            tiptype:function(msg){
                layer.msg(msg);
            },
            tipSweep:true,
            ajaxPost:true,
            callback:function(data){
                if(data.status=="y"){
					
					if(data.result.login_name=='gongxiao'){
							window.location.href="<?php echo site_url();?>gasstation/order/gongxiao_index";
						}else if(data.result.login_name=='risheng'){
							window.location.href="<?php echo site_url();?>gasstation/order/risheng_index";
						}else{
							window.location.href="<?php echo $redirect_url?>";
						}
                    
                }
            }
        });
    })
    function valid_code_refresh(valid_url)
	{
		typepos=valid_url.lastIndexOf(".");
		newurl=valid_url.substring(0,typepos)+"/"+Math.random();
		$("#valid_image").attr("src",newurl);
	}
	$(document).ready(function () {
	    if ($.cookie("rmbUser") == "true") {
		    $("#ck_rmbUser").attr("checked", true);
		    $("#usercode").val($.cookie("usercode"));
		    $("#password").val($.cookie("password"));
	    }
	    $("#usercode").focus();
	    $("body").keydown(function() {
	        if (event.keyCode == "13") {//keyCode=13是回车键
	            $('.webbtn').click();
	        }
	    });
	    $("#ck_rmbUser").click(function() {save();});
	});

	//记住用户名
	function save() {
	    if ($("#ck_rmbUser").attr("checked")) {
	        var str_username = $("#usercode").val();
	        var str_password = $("#password").val();
	        $.cookie("rmbUser", "true", { expires: 7 }); //存储一个带7天期限的cookie
	        $.cookie("usercode", str_username, { expires: 7 });
	        $.cookie("password", str_password, { expires: 7 });
	    }
	    else {
	        $.cookie("rmbUser", "false", { expire: -1 });
	        $.cookie("usercode", "", { expires: -1 });
	    }
	}
</script>
</body>
<!-- END BODY -->
</html>